{include file="public/header" /}
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.fuwu_personal}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.fuwu_personal_search_phone}</dt>
                <dd><input class="txt" name="search_phone" id="search_phone" value="{$search_phone}" type="text"></dd>
                <dt>{$Think.lang.fuwu_personal_search_skill}</dt>
                <dd>
                    <select name="search_skillid">
                        <option value="">--请选择</option>
                        {foreach name='skillArr' item='v'}
                        <option value="{$v.id}" {if $search_skillid==$v.id } selected {/if}>{$v.name} </option>
                            {/foreach} </select> </dd> <dt>{$Think.lang.fuwu_personal_search_grade}</dt>
                <dd>
                    <select name="search_grade">
                        <option value="">--请选择</option>
                        {foreach name='gradeArr' item='v'}
                        <option value="{$v.id}" {if $search_grade==$v.id } selected {/if}>{$v.name} </option> {/foreach}
                            </select> </dd> <dt>{$Think.lang.fuwu_personal_search_code}</dt>
                <dd><input class="txt" name="search_code" id="search_code" value="{$search_code}" type="text"></dd>
                <dt>{$Think.lang.fuwu_personal_search_code1}</dt>
                <dd><input class="txt" name="search_prevcode" id="search_prevcode" value="{$search_prevcode}"
                        type="text"></dd>
                <dt>{$Think.lang.fuwu_personal_search_admin_name}</dt>
                <dd><input class="txt" name="search_admin_name" id="search_admin_name" value="{$search_admin_name}"
                        type="text"></dd>
                <dt>{$Think.lang.fuwu_personal_search_status}</dt>
                <dd>
                    <select name="search_status">
                        <option value="">--请选择</option>
                        <option value="1" {if $search_status=="1" } selected {/if}>启用 </option> <option value="2" {if
                            $search_status=="2" } selected {/if}>禁用 </option> </select> </dd> </dl> <dl>
                <dt>注册时间</dt>
                <dd>
                    <input type="text" class="txt date" name="query_start_time" id="query_start_time"
                        value="{$Request.param.query_start_time}">
                    &nbsp;–&nbsp;
                    <input id="query_end_time" class="txt date" type="text" name="query_end_time"
                        value="{$Request.param.query_end_time}">
                </dd>
            </dl>
            <div class="btn_group">
                <a href="javascript:document.formSearch.submit();" class="btn "
                    title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                {if $search_grade!='' || $search_skillid!='' || $search_phone != ''||$search_prevcode!='' ||
                $search_code!='' || $search_admin_name !='' || $search_status != ''}
                <a class="btn" href="{:url('Fupersonal/index')}"
                    title="{$Think.lang.ds_cancel_search}"><span>{$Think.lang.ds_cancel_search}</span></a>
                {/if}
                <!--<a class="btn btn-default" href="javascript:export_xls('{:url('Brand/export_step1')}')"><span>{$Think.lang.ds_export}Excel</span></a>-->
            </div>
        </div>
    </form>
    <table class="ds-default-table">
        <thead>
            <tr class="thead">
                <th class="w24"></th>
                <th>{$Think.lang.fuwu_personal_code}</th>
                <th>{$Think.lang.fuwu_personal_skillid}</th>
                <th class="w150">{$Think.lang.fuwu_personal_phone}</th>
                <th class="w150">{$Think.lang.fuwu_personal_money}</th>
                <!-- <th class="w150">{$Think.lang.fuwu_personal_avtar}</th> -->
               <th class="w150">{$Think.lang.fuwu_personal_name}</th>
                <th class="w150">{$Think.lang.fuwu_personal_sex}</th>
                <th class="w150">{$Think.lang.fuwu_personal_code1}</th>
                <th class="w150">{$Think.lang.fuwu_personal_prevtype}</th>
                <!--<th class="w150">{$Think.lang.fuwu_personal_address}</th>-->
                <th class="w150">{$Think.lang.fuwu_personal_gradeid}</th>
                <th class="w150">{$Think.lang.fuwu_personal_cardstatus}</th>
                <!--<th class="w150">{$Think.lang.fuwu_personal_admin_name}</th>-->
                <th class="w150">{$Think.lang.fuwu_personal_status}</th>
                <!--<th class="w150">{$Think.lang.fuwu_personal_createdtime}</th>-->
                <th class="w150">注册时间</th>
                <th class="w120 align-center">{$Think.lang.ds_handle}</th>
            </tr>
        </thead>
        <tbody>
            {notempty name="$data"}
            {foreach name="data" item="v"}
            <tr class="hover edit" id="ds_row_{$v.id}">
                <td><input value="{$v.id}" class="checkitem" type="checkbox" name="del_brand_id[]"></td>
                <td class="name">{$v.code}</td>
                <td class="name">{$v.skillname}</td>
                <td class="name">{$v.phone}</td>
                <th class="w150">{if $v.money}{$v.money}{else/}0.00{/if}元</th>
                <!-- <td class="name">{if $v.avtar}<img src="{$v.avtar}" width="60" />{/if}</td> -->
                <td class="name">{$v.name}</td>
                
                <td class="name">{if $v.sex==0} {$Think.lang.fuwu_personal_sex0} {elseif
                    $v.sex==1}{$Think.lang.fuwu_personal_sex1} {elseif $v.sex==2} {$Think.lang.fuwu_personal_sex2} {/if}
                </td>
                <td class="name">{$v.prevcode}</td>
                <td class="name">{if $v.prevtype==3}客户邀请{elseif $v.prevtype==4}服务人员邀请
                    {elseif $v.prevtype==2}运营商邀请{elseif $v.prevtype==1}{if $v.admin_id}后台添加{else/}注册{/if}{/if}</td>
                <td class="name">{$v.gradename}</td>
                <td class="name">
                    {if $v.cardstatus ==0} 未认证 {elseif $v.cardstatus ==1} 认证成功 {elseif $v.cardstatus ==2} 认证失败 {elseif
                    $v.cardstatus ==3} 已提交信息等待认证 {/if}
                </td>
                <!--<td class="name">{$v.admin_name}</td>-->
                <td class="name">
                    {if $v.status == '0'}
                    <a
                        href="JavaScript:dsLayerConfirm('{:url('Fupersonal/edit_status',['column'=>'status','value'=>1,'id'=>$v.id])}','{$Think.lang.ds_ensure_edit_status}',{$v.id});"><img
                            src="{$Think.ADMIN_SITE_ROOT}/images/dispatch_jump_error.png" width="22px"></a>
                    {else /}
                    <a
                        href="JavaScript:dsLayerConfirm('{:url('Fupersonal/edit_status',['column'=>'status','value'=>0,'id'=>$v.id])}','{$Think.lang.ds_ensure_edit_status}',{$v.id});"><img
                            src="{$Think.ADMIN_SITE_ROOT}/images/dispatch_jump_success.png"></a>
                    {/if}
                </td>
                <td class="name">{$v.created_at}</td>
                <!-- <td class="name">{$v.updated_at}</td> -->
                <td class="align-center">
                    {if $is_super_admin == 1}
                    <a href="javascript:dsLayerOpen2('{:url('Fupersonal/updateYu',['id'=>$v.id])}','修改余额')"
                        class="dsui-btn-edit"><i class="iconfont"></i>修改余额
                    </a>
                    {/if}
                    {if $v.cardstatus == 0}
                    <a style="width:90px;" href="{:url('Fupersonal/shiming',['id'=>$v.id])}" class="dsui-btn-edit"><i
                            class="iconfont"></i>添加实名认证</a>
                    {/if}
                    <a href="javascript:dsLayerOpen('{:url('Fupersonal/view',['id'=>$v.id])}','查看详情')"
                        class="dsui-btn-view"><i class="iconfont"></i>查看详情</a>
                    <!--<a href="{:url('Fupersonal/addJineng',['id'=>$v.id])}" class="dsui-btn-edit"><i class="iconfont"></i>添加技能</a>-->
                    <a href="{:url('Fupersonal/jineng',['id'=>$v.id])}" class="dsui-btn-edit"><i
                            class="iconfont"></i>技能列表</a>
                    <a href="{:url('Fuaddress/index',['id'=>$v.id])}" class="dsui-btn-edit"><i
                            class="iconfont"></i>区域查看</a>
                    <a href="{:url('Fupersonal/edit',['id'=>$v.id])}" class="dsui-btn-edit"><i
                            class="iconfont"></i>{$Think.lang.ds_edit}</a>
                    <a href="javascript:dsLayerConfirm('{:url('Fupersonal/del',['id'=>$v.id])}','{$Think.lang.ds_ensure_del}',{$v.id})"
                        class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="no_data">
                <td colspan="10">{$Think.lang.ds_no_record}</td>
            </tr>
            {/notempty}
        </tbody>
        <tfoot>
            {notempty name="data"}
            <tr colspan="15" class="tfoot">
                <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
                <td colspan="16">
                    <label for="checkallBottom">{$Think.lang.ds_select_all}</label>
                    &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn btn-small"
                        onclick="submit_delete_batch()"><span>{$Think.lang.ds_del}</span></a>
                </td>
            </tr>
            {/notempty}
        </tfoot>
    </table>
    {$showpage}
    <div class="clear"></div>
</div>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
<script type="text/javascript">
    $(function () {
        $('#query_start_time').datepicker({
            dateFormat: 'yy-mm-dd'
        });
        $('#query_end_time').datepicker({
            dateFormat: 'yy-mm-dd'
        });
    });

    function submit_delete(ids_str) {
        _uri = ADMINSITEURL + "/Fupersonal/del.html?id=" + ids_str;
        dsLayerConfirm(_uri, '{$Think.lang.ds_ensure_del}');
    }

    function dsLayerOpen2(url, title) {
        layer.open({
            type: 2,
            title: title,
            area: ['700px', '300px'],
            fixed: false, //不固定
            maxmin: true,
            // content: url
            content: [url, 'no']
        });
    }
</script>